'''
Created on 20/ago/2012

@author: esgrano
'''

import threading
import utility
from host import host

class CommandExecute(threading.Thread):
    
    __command = None
    __libexec = None
    __contacts = []
    __smsCommand = None
    __nomeThread = None
    
   
#    def __init__(self,command,libexec,contacts,smsCommand):
#        self.__command = command
#        self.__libexec = libexec
#        self.__contacts = contacts
#        self.__smsCommand = smsCommand
#        threading.Thread.__init__(self)
#        self.__nomeThread = threading.Thread.getName(self)
        
    def run(self, command):
        c = command()
        h = host()
        c = command
        h = c.getHost()
        if c.getStatus() == utility.NAGIOS_CRITICAL:
            utility.sendSMS(self.__smsCommand,h.getHostName(),c.getDescription(),self.__contacts)
